"! A simple time representation "
Magnitude subclass: Time [
| millis |
<category: 'Library-Numbers'>
"! Info:
Return the sum of two times
Examples:

"
+ arg [
^ Time newMillis: (millis + arg milliseconds)
]

"! Return the difference of two times "
- arg [
^ Time newMillis: (millis - arg milliseconds)
]

"! Compare to another time "
< arg [
^ millis < arg milliseconds
]

"! Compare to another time "
= arg [
^ self = arg milliseconds
]

"! This time in milliseconds "
milliseconds [
^ millis
]

"! Return a new Time, ms milliseconds after this time "
millisecondsLater: ms [
^ Time newMillis: (millis + ms)
]

"! "
printString [
^ millis printString+'ms'  ]

"! This time in seconds "
seconds [
^ millis / 1000
]

]

"! Class methods for Time "
MetaMagnitude subclass: MetaTime [
<category: 'Library-Numbers'>
"! Info:
Return the number (an integer) of milliseconds since startup.
Examples:

"
msSinceStartup [
<timeStartupMS>
]

"! Create a new Time object specified as ms milliseconds since startup "
newMillis: ms [
^ self in: self new at: 1 put: ms
]

"! Return the time since startup "
sinceStartup [
^ self newMillis: self msSinceStartup
]

"! Info:
perform aBlock ntimes and time how long the entire process takes.
Examples:

"
time: aBlock times: ntimes [
|start|

start := self sinceStartup.
1 to: ntimes do: [ :n |
	aBlock value.
].
^ (self sinceStartup - start).
]

]

